<?php

namespace App\Models;

use DateTimeInterface;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

/**
 * Class Branch
 * *
 * @property $id  自增ID
 * @property $name  分馆名称
 * @property $image  分馆图片
 * @property $business_hours  开馆时间
 * @property $address  分馆地址
 * @property $map  地图信息
 * @property $publisher_uid  发布者uid
 * @property $created_at
 * @property $updated_at
 * @property $deleted_at
 *
 * @package  App\Models
 * @mixin \Illuminate\Database\Eloquent\Builder
 */
class Branch extends Model
{
    use SoftDeletes;

    protected $table = 'branches';

    protected $fillable = ['id', 'name', 'business_hours', 'address', 'image', 'map', 'publisher_uid'];

    protected function serializeDate(DateTimeInterface $date)
    {
        return $date->format($this->dateFormat ?: 'Y-m-d H:i:s');
    }
}
